package com.example.yian;

import com.example.yian.config.WebSocketConfig;
import com.example.yian.controller.ChatWebSocketHandler;
import org.apache.catalina.core.ApplicationContext;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan(basePackages = {"com.example.yian"})
@MapperScan("com.example.yian.mapper")
public class YianApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(YianApplication.class, args);
        ChatWebSocketHandler.setApplicationContext(applicationContext);
    }
}
